Crate bevy_utils

source ·
Expand description

General utilities for first-party Bevy engine crates.

Re-exports

Modules

Macros

  • Helper macro to generate tuple pyramids. Useful to generate scaffolding to work around Rust lacking variadics. Invoking all_tuples!(impl_foo, start, end, P, Q, ..) invokes impl_foo providing ident tuples through arity start..=end.
  • Macro to define a new label trait
  • Like tracing::trace, but conditional on cargo feature detailed_trace.

Structs

  • A Hasher for hashing an arbitrary stream of bytes.
  • A Duration type to represent a span of time, typically used for system timeouts.
  • A BuildHasher that results in a EntityHasher.
  • A very fast hash that is only designed to work on generational indices like Entity. It will panic if attempting to hash a type containing non-u64 fields.
  • A hasher builder that will create a fixed hasher.
  • A wrapper for floats that implements Ord, Eq, and Hash traits.
  • A pre-hashed value of a specific type. Pre-hashing enables memoization of hashes that are expensive to compute. It also enables faster PartialEq comparisons by short circuiting on hash equality. See PassHash and PassHasher for a “pass through” BuildHasher and Hasher implementation designed to work with Hashed See PreHashMap for a hashmap pre-configured to use Hashed keys.
  • A type which calls a function when dropped. This can be used to ensure that cleanup code is run even in case of a panic.
  • A BuildHasher that results in a PassHasher.
  • A no-op hash that only works on u64s. Will panic if attempting to hash a type containing non-u64 fields.
  • Provides a Hasher factory. This is typically used (e.g. by HashMap) to create AHashers in order to hash the keys of the map. See build_hasher below.
  • A Universally Unique Identifier (UUID).

Enums

  • Much like a Cow, but owned values are Arc-ed to make clones cheap. This should be used for values that are cloned for use across threads and change rarely (if ever).

Traits

Functions

Type Aliases